<%@ page language="java" contentType="text/html;charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ page import="com.jack.bookshop.vo.ResultVo"%>
<%@ page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page isELIgnored="false" %>

<!DOCTYPE html>
<html>
<head>
  <!-- 导入资源 -->
  <%@ include file="resource.jsp"%>
</head>
<body>
<!-- 导入页头 -->
<%@ include file="header.jsp"%>
<div class="container" style="margin: 24px auto;">
  <div class="row">
    <div>
      <h2 class="center">User Signin</h2>
      <!-- 登录成功 显示如下信息 -->
      <c:if test="${sessionScope.userVo.id>0}">
        <h4>${sessionScope.userVo.username} Signin Success! Go to
          <a href="index.jsp" class="btn btn-primary">Home</a> or
          <a href="cart.jsp" class="btn btn-primary">Shopping Cart</a> .
        </h4>
      </c:if>
      <!-- 登录失败 显示如下信息 -->
      <c:if test="${sessionScope.userVo==null||sessionScope.userVo.id==0}">
        <c:forEach var="str" items='${requestScope.resultVo.list}'
                   varStatus="varStatus">
          <p class="alert alert-danger">${varStatus.count}. ${str}</p>
        </c:forEach>
        <a href="signin.jsp" class="btn btn-primary">Back to Signin</a>
      </c:if>
    </div>
  </div>
</div>
<!-- 导入页脚 -->
<%@ include file="footer.jsp"%>
</body>
</html>
